<?php
use \sy\base\Router;
?>
<!DOCTYPE html>
<html>
<head>
	<title>文章 - SYBlog</title>
	<?php $this->display('common/header'); ?>
</head>
<body>
	<?php $this->display('common/navbar'); ?>
	<div class="page-content">
		<h2 class="title">文章</h2>
		<table class="striped">
			<thead><tr><th>标题</th><th class="action">操作</th></tr></thead>
			<tbody id="list"></tbody>
		</table>
		<ul id="page" class="pagination"></ul>
	</div>
	<div class="fixed-action-btn">
		<a href="<?=Router::createUrl('admin/article/write')?>" class="waves-effect waves-circle waves-light btn-floating btn-large red"><i class="material-icons mdi-add"></i></a>
	</div>
	<div id="list_edit" class="modal">
		<div class="modal-content">
			<h4>快速编辑</h4>
			<input type="hidden" id="aid"/>
			<div class="row">
				<div class="input-field col s12">
					<input id="title" type="text" placeholder="标题"/>
					<label class="active" for="title">标题</label>
				</div>
				<div class="input-field col s12">
					<input id="datetime" type="text" placeholder="时间"/>
					<label class="active" for="datetime">时间</label>
				</div>
				<div class="input-field col s12">
					<label class="active">Tags</label>
					<span id="tag_box" class="selection">
						<ul>
							<li class="selection-input"><input id="tag_input" class="selection-input-field" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" type="text"/></li>
						</ul>
						<ul id="tag_select" id="dropdown1" class="dropdown-content selection-list"></ul>
					</span>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<a id="edit_full_mode" class="modal-action modal-close waves-effect btn-flat">完整模式</a>
			<a id="article_submit" type="button" class="modal-action modal-close waves-effect btn-flat">保存</a>
			<a class="modal-action modal-close waves-effect btn-flat">取消</a>
		</div>
	</div>
	<script>
	window.sy = {
		"url": {
			"list": "<?=Router::createUrl('admin/article/list', 'json')?>",
			"meta": "<?=Router::createUrl('admin/meta/get', 'json')?>",
			"ajaxEdit": "<?=Router::createUrl('admin/article/edit', 'json')?>",
			"ajaxDel": "<?=Router::createUrl('admin/article/del', 'json')?>",
			"edit": "<?=Router::createUrl(['admin/article/write','id'=>'__id__'])?>",
			"view": "<?=Router::createUrl(['article/view','id'=>'__id__'])?>",
		},
		"page": "ArticleList"
	};
	</script>
	<?php $this->display('common/footer'); ?>
</body>
</html>